@include('admin.header')

<style type="text/css">
  .opartion {
    width: 5%;
  }

  .pagination {
    list-style: none;
    float: right;
  }

  .pagination li {
    float: left;
    padding-left: 5px;
    padding-right: 5px;
  }

  .input_search {
    margin-top: 10px;
  }
</style>

<div class="wrap">
  <form class="form-horizontal js-ajax-form" method="post" novalidate="novalidate">
    <table class="table table-hover table-bordered">
      <thead>
      <tr>
        <th width="100">订单ID号</th>
        <th>订单编号</th>
        <th>商品名称</th>
        <th>商品价格</th>
        <th>支付方式</th>
        <th>支付时间</th>
        <th class="opartion">操作</th>
      </tr>
      </thead>
      <tbody>

      @foreach($order as $o)
        <tr>
          <td>{{$o->order_id}}</td>
          <td>{{$o->order_no}}</td>
          <td>{{$o->product_name . ' 等'}}</td>
          <td>{{$o->amount or ''}}</td>
          <td>{{$o->pay_type}}</td>
          <td>{{$o->pay_time}}</td>
          <td>
            <a class="order_detail" _id="{{$o->order_id}}"
               order_no="{{$o->order_no}}">详情</a>
          </td>
        </tr>
      @endforeach
      </tbody>
    </table>

    <!-- 分页 -->
    @if (!empty($data))
      <div class="page_list">
        {{$data->links()}}
      </div>
    @endif

  </form>
</div>

<script>

  $(function(){
    //订单详情
    $('.order_detail').click(function(){
      //获取参数
      var id         = $(this).attr('_id') || 0;
      var nodename   = 'x';
      var introducer = 'x';
      var order_no   = $(this).attr('order_no');
      open_iframe_layer('/order/order_detail?id='+id+'&nodename='+nodename+'&introducer='+introducer+'&order_no='+order_no);
    });
  });
</script>